import productRequest from '@/utils/http/productRequest'


export type TrademarkListData = TrademarkData[]
export interface TrademarkData {
    id?: number | string;
    tmName: string;
    logoUrl: string;
}

export interface TrademarkListInfoData {
    records: TrademarkListData;
    total: number;
    size: number;
    current: number;
    searchCount: boolean;
    pages: number;
}


export default {
    getTrademark(page: number, limit: number) {
        return productRequest.get<any, TrademarkListInfoData>(`/admin/product/baseTrademark/${page}/${limit}`)
    },
    addTrademark(trademark: TrademarkData) {
        return productRequest.post<any, null>('/admin/product/baseTrademark/save', trademark)
    },
    updateTrademark(trademark: TrademarkData) {
        return productRequest.put('/admin/product/baseTrademark/update', trademark)
    },
    deleteTrademark(id: string | number) {
        return productRequest.delete<any, null>(`/admin/product/baseTrademark/remove/${id}`)
    }
}
